home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1993 July / InfoMagic USENET CD-ROM July 1993.ISO / answers / motif-faq / part4 < prev    next >
Encoding:
Text File  |  1993-06-30  |  59.0 KB  |  1,396 lines

  1. Newsgroups: comp.windows.x.motif,news.answers,comp.answers
  2. Path: senator-bedfellow.mit.edu!enterpoop.mit.edu!spool.mu.edu!sdd.hp.com!saimiri.primate.wisc.edu!caen!batcomputer!munnari.oz.au!newshost.anu.edu.au!csc.canberra.edu.au!news
  3. From: jan@ise.canberra.edu.au (Jan Newmarch)
  4. Subject: Motif FAQ (Part 4 of 5)
  5. Message-ID: <1993Jul1.011200.28031@csc.canberra.edu.au>
  6. Followup-To: comp.windows.x.motif
  7. Keywords: FAQ question answer
  8. Sender: news@csc.canberra.edu.au
  9. Reply-To: jan@ise.canberra.edu.au (Jan Newmarch)
  10. Organization: University of Canberra
  11. Date: Thu, 1 Jul 93 01:12:00 GMT
  12. Approved: news-answers-request@MIT.Edu
  13. Expires: +1 months
  14. Lines: 1379
  15. Xref: senator-bedfellow.mit.edu comp.windows.x.motif:18409 news.answers:9858 comp.answers:1163
  16.  
  17. Archive-name: motif-faq/part4
  18. Last-modified: Wed July 1 1993
  19. Version: 3.6
  20.  
  21.  
  22.  
  23.  
  24.  
  25.  
  26. -----------------------------------------------------------------------------
  27. Subject: 90) TOPIC: XMSTRING
  28. -----------------------------------------------------------------------------
  29. Subject: 91) How can I get the Ascii text out of an XmString?
  30.  
  31. Answer: To get the first line of text from a string created left-to-right
  32.  
  33.  
  34.         char *str;
  35.         XmString xmstr;
  36.  
  37.         /* stuff to create xmstr */
  38.         ...
  39.  
  40.         /* set str to point to the text */
  41.         XmStringGetLtoR(xmstr, XmSTRING_DEFAULT_CHARSET, &str);
  42.         /* use the string */
  43.         ...
  44.  
  45.         /* and reclaim space */
  46.         XtFree(str);
  47.  
  48.  
  49. -----------------------------------------------------------------------------
  50. Subject: 92) When can XmStrings used as resources be freed?
  51.  
  52. Answer: The policy OSF have been trying to enforce is that if you set an
  53. XmString or XmStringTable resource, the application is responsible for freeing
  54. the XmStrings used because the widget makes a copy.  If you get an XmString
  55. resource, then the application must free the value gotten.  If you get an
  56. XmStringTable, then the application should NOT free the value gotten.  If the
  57. application wants to manipulate it, it should make a copy first. This policy
  58. appears to be implemented progressively, so may be less true for Motif 1.0
  59. than 1.1.
  60.  
  61. -----------------------------------------------------------------------------
  62. Subject: 93) Why doesn't XmStringGetNextSegment() work properly?
  63.  
  64. Answer: The documentation in Motif 1.0 is in error. Instead of
  65.  
  66.         XmStringGetnextSegment(context, ...)
  67.         XmStringContext * context;
  68.  
  69. it should be
  70.  
  71.         XmStringGetnextSegment(context, ...)
  72.         XmStringContext context;
  73.  
  74. i.e. with no indirection.
  75.  
  76.  
  77. -----------------------------------------------------------------------------
  78. Subject: 94)+ Why does using XmStringDraw cause a Bad Font error?
  79.  
  80. [Last modified: May 93]
  81.  
  82. Answer: From Thomas Berlage (berlage@gmdzi.gmd.de): You could call this a bug
  83. in Motif. You pass a GC to XmStringDraw, however, Motif wants to use the fonts
  84. from the font list to draw the string.  Therefore it replaces the font of the
  85. GC temporarily with some fonts of its own as specified in the font list. In
  86. the end it tries to restore the old font of the GC. There comes the problem:
  87.  
  88. If a GC uses the default font, the client side GC structure does not have a
  89. valid font id (that is the 0xffffffff you may see in the error message). Motif
  90. tries to restore this invalid id at the end.
  91.  
  92. The workaround is: Before drawing with XmStringDraw, set the font id of the GC
  93. to any valid font id, for example using
  94.  
  95.       XSetFont (display, gc, XLoadFont (display, "fixed"));
  96.  
  97.  
  98.  
  99.  
  100. -----------------------------------------------------------------------------
  101. Subject: 95) TOPIC: DIALOGS
  102.  
  103. -----------------------------------------------------------------------------
  104. Subject: 96) How do I stop my dialog disappearing when I press the help
  105. button?
  106.  
  107. Answer: Bulletin board has the resource autoUnmanage which defaults to True.
  108. This unmanages the widget when any button child is activated - including the
  109. help button.  Set this to False to stop it disappearing. Note that you then
  110. have to unmanage the bulletin board yourself when any other button is
  111. activated.
  112.  
  113. -----------------------------------------------------------------------------
  114. Subject: 97) How do I make my own dialog?  I want a dialog with my own set of
  115. buttons that stretch and shrink like the ones in e.g. PromptDialog and its own
  116. contents.
  117.  
  118. Answer: Start off with say a PromptDialog. Unmanage the buttons you don't want
  119. or manage the Apply button if you want another. Unmanage the other bits of the
  120. selection box you don't want. You can add another WorkArea child to the
  121. selection box for any extra stuff you want.
  122.  
  123.     /* Copyright 1990, Kee Hinckley and Brian Holt Hawthorne */
  124.     /* Permission granted for any use, provided this copyright */
  125.     /* notice is maintained. */
  126.  
  127.     /* Create a dialog box */
  128.     argcount = setArgs(&args, XmNautoUnmanage, False, NULL);
  129.     SomeDialog = XmCreatePromptDialog(mainShell, "someDialog", args, argcount);
  130.  
  131.     /* Now get rid of the things we don't want */
  132.     child = XmSelectionBoxGetChild(SomeDialog, XmDIALOG_SELECTION_LABEL);
  133.     XtUnmanageChild(child);
  134.     child = XmSelectionBoxGetChild(SomeDialog, XmDIALOG_TEXT);
  135.     XtUnmanageChild(child);
  136.  
  137.     /* set the callbacks, and make sure the buttons we want are there */
  138.     child = XmSelectionBoxGetChild(SomeDialog, XmDIALOG_OK_BUTTON);
  139.     XtAddCallback(child, XmNactivateCallback, callSomeFunc, someArg);
  140.     XtAddCallback(child, XmNactivateCallback, unManage, SomeDialog);
  141.     XtManageChild(child);
  142.     child = XmSelectionBoxGetChild(SomeDialog, XmDIALOG_APPLY_BUTTON);
  143.     XtAddCallback(child, XmNactivateCallback, callSomeFunc, someOtherArg);
  144.     XtManageChild(child);
  145.     child = XmSelectionBoxGetChild(SomeDialog, XmDIALOG_CANCEL_BUTTON);
  146.     XtAddCallback(child, XmNactivateCallback, dialogUnmanage, SomeDialog);
  147.     XtManageChild(child);
  148.  
  149.     /* Add a new work area. This can be any manager. */
  150.     child = XmCreateForm(SomeDialog, "someForm", NULL, 0);
  151.     XtManageChild(child);
  152.  
  153.     /* and fill it up... */
  154.     something = doYourStuff(child);
  155.  
  156.  
  157.  
  158. -----------------------------------------------------------------------------
  159. Subject: 98) How come the title bars for my dialogs now have "_popup" or "<-
  160. popup" concatenated onto the widget name?
  161.  
  162.  
  163. Answer: Motif 1.0.3 (?) "fixed" things such that title bars without an
  164. explicit dialogTitle setting use the widget name with "_popup" or whatever
  165. added on.  Set the dialogTitle resource explicitly if you don't want this new
  166. default naming scheme.
  167.  
  168. -----------------------------------------------------------------------------
  169. Subject: 99) How can I force a dialog window to display?  I manage a "working"
  170. dialog, and do some computing, but the dialog window appears blank until the
  171. work has finished.  How can I force it to be displayed?
  172.  
  173. Answer: Use this.  (David Brooks, Systems Engineering, Open Software
  174. Foundation)
  175.  
  176. /*
  177.  * This procedure will ensure that, if a dialog window is being mapped,
  178.  * its contents become visible before returning.  It is intended to be
  179.  * used just before a bout of computing that doesn't service the display.
  180.  * You should still call XmUpdateDisplay() at intervals during this
  181.  * computing if possible.
  182.  *
  183.  * The monitoring of window states is necessary because attempts to map
  184.  * the dialog are redirected to the window manager (if there is one) and
  185.  * this introduces a significant delay before the window is actually mapped
  186.  * and exposed.  This code works under mwm, twm, uwm, and no-wm.  It
  187.  * doesn't work (but doesn't hang) with olwm if the mainwindow is iconified.
  188.  *
  189.  * The argument to ForceDialog is any widget in the dialog (often it
  190.  * will be the BulletinBoard child of a DialogShell).
  191.  */
  192.  
  193. ForceDialog(w)
  194.      Widget w;
  195. {
  196.   Widget diashell, topshell;
  197.   Window diawindow, topwindow;
  198.   Display *dpy;
  199.   XWindowAttributes xwa;
  200.   XEvent event;
  201.   XtAppContext cxt;
  202.  
  203. /* Locate the shell we are interested in.  In a particular instance, you
  204.  * may know these shells already.
  205.  */
  206.  
  207.   for (diashell = w;
  208.        !XtIsShell(diashell);
  209.        diashell = XtParent(diashell))
  210.     ;
  211.  
  212. /* Locate its primary window's shell (which may be the same) */
  213.  
  214.   for (topshell = diashell;
  215.        !XtIsTopLevelShell(topshell);
  216.        topshell = XtParent(topshell))
  217.     ;
  218.  
  219.   if (XtIsRealized(diashell) && XtIsRealized(topshell)) {
  220.     dpy = XtDisplay(topshell);
  221.     diawindow = XtWindow(diashell);
  222.     topwindow = XtWindow(topshell);
  223.     cxt = XtWidgetToApplicationContext(diashell);
  224.  
  225. /* Wait for the dialog to be mapped.  It's guaranteed to become so unless... */
  226.  
  227.     while (XGetWindowAttributes(dpy, diawindow, &xwa),
  228.            xwa.map_state != IsViewable) {
  229.  
  230. /* ...if the primary is (or becomes) unviewable or unmapped, it's
  231.    probably iconified, and nothing will happen. */
  232.  
  233.       if (XGetWindowAttributes(dpy, topwindow, &xwa),
  234.           xwa.map_state != IsViewable)
  235.         break;
  236.  
  237. /* At this stage, we are guaranteed there will be an event of some kind.
  238.    Beware; we are presumably in a callback, so this can recurse. */
  239.  
  240.       XtAppNextEvent(cxt, &event);
  241.       XtDispatchEvent(&event);
  242.     }
  243.   }
  244.  
  245. /* The next XSync() will get an expose event if the dialog was unmapped. */
  246.  
  247.   XmUpdateDisplay(topshell);
  248. }
  249.  
  250.  
  251. -----------------------------------------------------------------------------
  252. Subject: 100) How can I control placement of a popup widget?  Each time a
  253. popup is created, it is placed in or over the middle of its parent.  How can I
  254. make it obey the XmNx and XmNy values?
  255.  
  256. Answer: Set the resource XmNdefaultPosition for the popup to False.  Set the
  257. position of the popup by the resource values of XmNx and XmNy.  Do not use
  258. XtMoveWidget, as this is for widget writers only.  Here's a demo program from
  259. Dan Heller:
  260.  
  261. /* Written by Dan Heller.  Copyright 1991, O'Reilly && Associates.
  262.  * This program is freely distributable without licensing fees and
  263.  * is provided without guarantee or warranty expressed or implied.
  264.  * This program is -not- in the public domain.  This program is
  265.  * taken from the Motif Programming Manual, O'Reilly Volume 6.
  266.  */
  267.  
  268. /* map_dlg.c -- Use the XmNmapCallback to automatically position
  269.  * a dialog on the screen.  Each time the dialog is displayed, it
  270.  * is mapped down and to the right by 200 pixels in each direction.
  271.  */
  272. #include <Xm/MessageB.h>
  273. #include <Xm/PushB.h>
  274.  
  275. /* main() --create a pushbutton whose callback pops up a dialog box */
  276. main(argc, argv)
  277. char *argv[];
  278. {
  279.     Widget toplevel, button;
  280.     XtAppContext app;
  281.     void pushed();
  282.  
  283.     toplevel = XtVaAppInitialize(&app, "Demos",
  284.         NULL, 0, &argc, argv, NULL, NULL);
  285.  
  286.     button = XtCreateManagedWidget("button", xmPushButtonWidgetClass,
  287.         toplevel, NULL, 0);
  288.     XtAddCallback(button, XmNactivateCallback, pushed, "Hello World");
  289.  
  290.     XtRealizeWidget(toplevel);
  291.     XtAppMainLoop(app);
  292. }
  293.  
  294. /* callback function for XmNmapCallback.  Position dialog in 200 pixel
  295.  * "steps".  When the edge of the screen is hit, start over.
  296.  */
  297. static void
  298. map_dialog(dialog, client_data, cbs)
  299. Widget dialog;
  300. XtPointer client_data;
  301. XmAnyCallbackStruct *cbs;
  302. {
  303.     static Position x, y;
  304.     Dimension w, h;
  305.  
  306.     XtVaGetValues(dialog, XmNwidth, &w, XmNheight, &h, NULL);
  307.     if ((x + w) >= WidthOfScreen(XtScreen(dialog)))
  308.         x = 0;
  309.     if ((y + h) >= HeightOfScreen(XtScreen(dialog)))
  310.         y = 0;
  311.     XtVaSetValues(dialog, XmNx, x, XmNy, y, NULL);
  312.     x += 200, y += 200;
  313. }
  314.  
  315. /* pushed() --the callback routine for the main app's pushbutton.
  316.  * Create and popup a dialog box that has callback functions for
  317.  * the Ok, Cancel and Help buttons.
  318.  */
  319. void
  320. pushed(w, message)
  321. Widget w;
  322. char *message; /* The client_data parameter passed by XtAddCallback */
  323. {
  324.     Widget dialog;
  325.     Arg arg[3];
  326.     XmString t = XmStringCreateSimple(message);
  327.     extern void response();
  328.  
  329.     XtSetArg(arg[0], XmNautoUnmanage, False);
  330.     XtSetArg(arg[1], XmNmessageString, t);
  331.     XtSetArg(arg[2], XmNdefaultPosition, False);
  332.     dialog = XmCreateMessageDialog(w, "notice", arg, 3);
  333.     XmStringFree(t);
  334.  
  335.     XtAddCallback(dialog, XmNmapCallback, map_dialog, NULL);
  336.  
  337.     XtManageChild(dialog);
  338.     XtPopup(XtParent(dialog), XtGrabNone);
  339. }
  340.  
  341.  
  342. -----------------------------------------------------------------------------
  343. Subject: 101) TOPIC: LANGUAGE BINDINGS
  344.  
  345. -----------------------------------------------------------------------------
  346. Subject: 102)*  Is there a C++ binding for Motif?
  347.  
  348. [Last modified: May 93]
  349.  
  350.  
  351. Answer: WWL is a library which defines C++ classes around X Toolkit Widgets.
  352. It is intended to simplify the task of C++ code writers when using the Toolkit
  353. by providing them with C++ objects, methods, type checking and several utility
  354. functions and classes.
  355.  
  356. WWL has been tested under SunOs4.0.3 on sun3 and sun4, HPUX version 6.5 and
  357. 7.0 and Ultrix 4.0 on DECstation 3100 and 5000. It is expected to work on most
  358. other UNIX systems without too many problems.
  359.  
  360. WWL is distributed as a tar file with all the source, documentation and
  361. example. The file is available using anonymous ftp from
  362.  
  363.         export.lcs.mit.edu (18.30.0.238   contrib/WWL-1.0.tar.Z
  364.         lri.lri.fr (129.175.15.1)      pub/WWL-1.0.tar.Z
  365.  
  366.  
  367. Answer: Rogue Wave Software has a C++ binding for Motif called View.h++.
  368.  
  369. "View.h++ is a complete C++ interface to OSF/Motif.  It doesn't just
  370. encapsulate it, but also includes a set of classes that provide a level of
  371. abstraction above Motif, thus simplifying menu and dialog creation, XmStrings,
  372. XmFontLists, etc.  View.h++ supports a Model- View-Controller architecture,
  373. allowing for an even more object-oriented interface design.  Includes a copy
  374. of Rogue Wave's Tools.h++ (foundation class library)"
  375.  
  376. An object license is $795 "per seat" and a source code license is available
  377. for $2,995 "per seat."  Rogue Wave also offers full support for View.h++.
  378.  
  379. It is currently available for Sun Sparc, IBM RS/6000, HP 9000/700 series, SCO,
  380. Intel SVR4 ESIX.  Please call for Silicon Graphics and DEC Ultrix status.
  381.  
  382. For additional information, please contact:
  383.  
  384. Matt Steinauer
  385. Rogue Wave Software, Inc.
  386. P.O. Box 2328
  387. Corvallis, OR 97339
  388. Phone: (503)754-3010
  389. Fax:   (503)757-6650
  390.  
  391. email:   matts@roguewave.com
  392.  
  393.  
  394. Answer: From Andreas.Baecker@gmd.de: The GINA++ application framework contains
  395. an encapsulation of the OSF/Motif widg et classes and the Xt functionality
  396. into C++ classes. Its functionality is comparab le to that of the ULowell
  397. binding and the WWL. Additionally, it provides an easy-to -use framework for
  398. modeling new composite and primitive widget classes, plus an application
  399. framework similar to ET++ or MacApp build on top of it. The binding may be
  400. used independently from the framework classes. GINA++ is available through
  401. anonymous ftp from ftp.gmd.de [129.26.8.90] in the directory /gmd/ginaplus.
  402. Documentation about the Motif binding has been published in the X Resource
  403. Journ al, Number 2, 1992, Pages 106-130. The binding compiles with AT&T C++
  404. 2.1 and GNU G+ + 2.1 and has been tested on SunOS 4.1.[12], X11R4 and Motif
  405. 1.1.3.
  406.  
  407. Answer: Motif++ is a library that defines C++ class "wrappers" for the widgets
  408. defined in the OSF/Motif-1.1 widget library. Motif++ is also an application
  409. toolkit that provides other tools in conjunction with the widget wrapper
  410. classes.  It has support for the Xbae widget set, plus other widgets.  It has
  411. Imake support, and lots of test files.
  412.  
  413. Motif++ is very similar to other public domain widget libraries such as The
  414. Widget Wrapper Library (WWL) and the C++ Binding for OSF/Motif developed at
  415. the Univeristy of Lowell. The two latter libraries are the result of much
  416. larger efforts.
  417.  
  418. Availability:
  419.  
  420. Anonymous ftp at decuac.dec.com (192.5.214.1), directory /pub/X11,
  421. file motif++.21.jul.92.tar.Z (855293 bytes).
  422.  
  423. For more information, contact Ronald van Loon (rvloon@cv.ruu.nl) There is also
  424. mailing list for Motif++. Send e-mail to 'motif++-request@cv.ruu.nl' or
  425. 'rvloon@cv.ruu.nl'
  426.  
  427. Answer: From Christian Goeller (goeller@seufert.de): We have a C++-class-
  428. library available. It's based on the Lowell-bindings and the work of Ronald
  429. van Loon (rvloon@cv.ruu.nl) and has a lot of (i hope) useful enhancements like
  430. containers, string-class (with Motif-support) and a graph-object.  It should
  431. build completely with imake.  You could ftp it from:
  432.  
  433. Host: ftp.unibw-muenchen.de
  434. File: /pub/Motif-C++/v2.0.tar.Z
  435.  
  436.  
  437. Answer: Xm++ is a user interface framework for the C++ language built upon X11
  438. and the X-Toolkit. It is designed to be a simple and intuitive programming
  439. interface to access the functionality of commonly used widgets.  Xm++ was
  440. initially created for the Motif widget set, now support for the Athena widgets
  441. was added. Applications created with Xm++ run in both environments without
  442. changes, although many nice features are only available when using Motif.
  443.  
  444. Xm++ is available on: export.lcs.mit.edu as: /contrib/Xm++.0.5.tar.Z
  445.  
  446. Answer: The Solbourne OI toolkit (not Motif) also has a C++ binding.
  447.  
  448. Answer: Liant have C++/Views.
  449.  
  450. Answer: Quest have ObjectViews.
  451.  
  452. Answer: Doug Young has written a book "Object Oriented Programming with C++
  453. and Motif", Prentice-Hall ISBN 0-13-630252-1 about using C++ without requiring
  454. one of these toolkits.
  455.  
  456. -----------------------------------------------------------------------------
  457. Subject: 103)  How can I have a C++ member function in a callback?
  458.  
  459. [Last modified: December 92]
  460.  
  461. Answer: Motif++ has a nice tutorial summarising mechanisms (this is available
  462. separately by email from Ronald van Loon (rvloon@cv.ruu.nl)). Doug Young's
  463. book deals extensively with one of these. The problem is that you don't get
  464. the object when you just use the function as a callback.  You need to pass the
  465. object as a pointer through as the client_data.  (use "this" as the
  466. client_data.) Then you can retrieve the object's address, and dereference from
  467. there. For example (Leo O'Donnell, Email: leo@avs.com),
  468.  
  469.     class MyButton {
  470.       public:
  471.                 MyButton (Widget parent, const char *name) {
  472.                     _button = XtVaCreateManagedWidget (
  473.                         name, xmPushButtonWidgetClass, parent, NULL, 0);
  474.                     XtAddCallback (
  475.                         _button,
  476.                         XmNactivateCallback,
  477.                         &MyButton::activateCB,
  478.                         (XtPointer) this);
  479.                 }
  480.                 ~MyButton () { XtDestroyWidget (_button); }
  481.       private:
  482.         Widget  _button;
  483.         static  void activateCB (Widget, XtPointer, XtPointer);
  484.     };
  485.  
  486.     void MyButton::activateCB (Widget, XtPointer thisBtn, XtPointer)
  487.     {
  488.         MyButton *btn = (MyButton *) thisBtn;
  489.  
  490.         // OK you've got the button instance now. Do some stuff with it!
  491.     }
  492.  
  493.  
  494.  
  495. -----------------------------------------------------------------------------
  496. Subject: 104)  Is there a Common Lisp binding for Motif?
  497.  
  498. [Last modified: November 92]
  499.  
  500. Answer: Try CLM. This includes a toolkit demon (in C) that takes a widget
  501. description (with callbacks), and forks a new process for each Motif
  502. application (which can be just a single menu, or whatever).  Lisp can then
  503. continue running, with a separate lightweight lisp process handling the
  504. connection & callbacks.  In North America & net environs, CLM-2.0beta is
  505. available from export.lcs.mit.edu.
  506.  
  507. There is also CLIM, the Common Lisp Interface Manager. It provides access to
  508. motif and other toolkits and window systems.  Here is some blurb: "Version 2.0
  509. of the Common Lisp Interface Manager (CLIM) provides access to Motif. CLIM is
  510. the emerging standard for GUI development in Common Lisp.  It offers a set of
  511. high-level facilities that enable rapid construction of user interfaces.
  512. Applications written using CLIM are portable across a variety of window
  513. systems and toolkits.  For example, on the X window System, both Motif
  514. (OSF/Motif) and Openlook (OLIT) are supported.  CLIM accesses the toolkit
  515. directly rather than emulating the look and feel."
  516.  
  517. CLIM is available from a variety of Common Lisp vendors including Symbolics
  518. and Franz Inc. (info@franz.com).
  519.  
  520.  
  521. -----------------------------------------------------------------------------
  522. Subject: 105)*  Is there an Ada binding for Motif?
  523.  
  524. [Last modified: July 93]
  525.  
  526. Answer:
  527.  
  528. Information on Ada bindings to Motif and other services (such as SQL and
  529. POSIX) can be found in a document maintained by the Ada Information
  530. Clearinghouse.  The report can be found at
  531.  
  532.         host:   ajpo.sei.cmu.edu
  533.         loc:    /public/ada-info/bindings.hlp.*
  534.         access: anonymous ftp
  535.  
  536. The suffix to the file (indicated above with an asterix) is the date of the
  537. latest update to the document.  For example, the full name of the report
  538. updated on 14 June 1993 would be
  539.  
  540.         /public/ada-info/bindings.hlp.14Jun93.
  541.  
  542. The file is ASCII.
  543.  
  544. ------ Included File
  545.  
  546.  
  547. [...Excerpted from the AdaIC report bindings.hlp.14Jun93...]
  548. [...Updates can be found on ajpo.sei.cmu.edu, in the    ...]
  549. [...file /public/ada-info/bindings.hlp.*  The suffix    ...]
  550. [...is always the date of the lastest version to the    ...]
  551. [...report.                                             ...]
  552.  
  553.                                      SECTION 12
  554.                                   X-Window System:
  555.                                OSF Motif and Open Look
  556.                                Available Ada Bindings
  557.  
  558.  
  559. 12.1  Description and Standardization Efforts
  560.  
  561. The X-Window System is a network-transparent window system.  It supports one
  562. or more screens containing overlapping windows or subwindows.  X display
  563. servers distribute user input to and accept output requests from various
  564. client programs located either on the same machine or elsewhere in the
  565. network.
  566.  
  567.             OSF Motif (Open Software Foundation/Motif) is a graphical user
  568.             interface from OSF that provides a Presentation Manager look and
  569.             feel for applications running on any system with X Window version
  570.             11.  It conforms to POSIX, ANSI C and X/Open's XPG3 standards.
  571.  
  572. 12.2  Resources Available from Software Reuse Libraries/Repositories
  573.  
  574.  
  575. ASSET                                                      (Updated:  November
  576. 1 992)
  577.  
  578. The following information was taken in its entirety from the ASSET Library
  579. Repository Catalog, October 9, 1992.  For more information on ASSET, see
  580. Appendix C.
  581.  
  582.  
  583. INTERFACE TO THE X WINDOW SYSTEM
  584.  
  585. VERSION_NUMBER    : 1.1
  586. DEVELOPED_BY      : SAIC
  587. RELEASE_DATE      : 29-SEP-88
  588. UNIQUE_IDENTIFIER : ASSET_A_240
  589. ALTERNATE_NAME    : SAICX2
  590. ASSET_TYPE        : SOFTWARE CODE
  591. FUNCTIONS         : INTERFACE, BIND
  592. OBJECTS           : ADA, X WINDOWS
  593. KEYWORDS          : STANDARDS, BINDINGS
  594. COLLECTION        : STARS FOUNDATIONS
  595. DISTRIBUTION      : UNLIMITED
  596.  
  597. DESCRIPTION       :
  598.  
  599. Interface to the X Window System
  600.       An expression of the various concepts in Ada that provides a full,
  601. working Ada specification of the X Window system.
  602.      Approved for public release; distribution is unlimited.
  603.  
  604. 12.3  Products Available from Vendors
  605.  
  606.  
  607. Advanced Technology Center                                 (Updated:  November
  608. 1 992)
  609.  
  610. The Advanced Technology Center (ATC) has an Ada binding to OSF Motif for their
  611. AXI~ product.  AXI is currently available for most UNIX-based platforms, and
  612. is supported by Verdix, Meridian, and TeleSoft compilers.
  613.  
  614. AXI is an Ada-to-X-Window System interface that provides the Ada programmer
  615. access to the 500+ functions, libraries, and procedures contained in the X
  616. library (Xlib), the X Toolkit (Xt), the X Extensible Library, the X
  617. Miscellaneous Utilities, the Motif widget set and the Motif Resource Manager.
  618.  
  619. ATC is planning to develop an Ada binding to Open Look for AXI.
  620.  
  621. For more information, contact:Larry Paulson, Advanced Technology Center, 22982
  622.                         Mill Creek Drive, Laguna Hills, CA  92653, USA; Phone:
  623.                         714-583-9119
  624.  
  625.  
  626. Alsys, Inc.                                                     (Updated:  May
  627. 1 992)
  628.  
  629. The Alsys Ada Software Development Environment (Alsys's validated Ada compiler
  630. #901221W1.11103) for 386 UNIX is a production-quality Ada environment capable
  631. of handling very large Ada applications (over 500,000 lines of code).  The
  632. product includes the Compiler; Multi-Library Environment, which provides a
  633. powerful and flexible way to manage Ada development effort and share program
  634. units; Binder, which supports unused subprograms elimination; High-and Low-
  635. Level Optimizers for improving code quality and performance; and Run-Time
  636. Executive for efficient support for executing Ada programs.  Also included is
  637. the Developer's Toolset including:  Ada Probe, a symbolic source level
  638. debugger and program viewer; AdaXref, a cross-reference generator; AdaMake, a
  639. recompilation aid; AdaReformat, a source reformatter.
  640.  
  641. Alsys currently has Ada bindings to POSIX, X-Windows (OSF Motif), and the
  642. Generic Package of Elementary Functions for the Alsys Ada Software Development
  643. Environment, running on 386 UNIX 386/486-based machines supported as both host
  644. and target and running 386/ix or SCO UNIX.  They are also planning a binding
  645. to SQL for  386/486 machines.
  646.  
  647. Host/Target:386/486 PC under IX UNIX, 386/486 PC under SCO UNIX
  648.  
  649. The Alsys Ada Software Development Environment for the IBM RS/6000 is a
  650. production-quality Ada environment capable of handling very large Ada
  651. applications.  Hosted on and targeted to the IBM RS/6000 workstation under
  652. IBM's AIX operating system, the product includes the Compiler; Multi-Library
  653. Environment, which provides a  powerful and flexible way to manage Ada
  654. development efforts and share program units; Binder; Run-Time Executive; and
  655. both a High and Low-Level Optimizer for improving code quality and
  656. performance.  Also included is the Alsys Ada Toolset including Ada Probe,
  657. symbolic source level debugger and program viewer; AdaXref, cross-reference
  658. generator; AdaMake, recompilation aid; and AdaReformat, source reformatter.
  659.  
  660. Alsys has bindings currently available to the Generic Package of Elementary
  661. Functions and to X-Windows (OSF Motif) for the Alsys Ada Development
  662. Environment for the IBM RS/6000 running on any RISC System/6000 machine as
  663. both host and target and running IBM's AIX operating system (Alsys's validated
  664. Ada compiler #910809W1.11195).   Alsys also plans to develop a POSIX binding
  665. for the RS/6000.
  666.  
  667. Host/Target:RISC System/6000 under AIX
  668.  
  669. The Alsys Ada Software Development Environment for SPARC Workstations is a
  670. production-quality Ada environment capable of handling very large Ada
  671. applications.  Hosted on any SPARC-based workstation under SunOS or SunView,
  672. the product helps you realize the full potential of Ada on SPARC machines. The
  673. product includes the Compiler (with High- and Low-Level Optimizers); Binder,
  674. which supports unused subprogram elimination; Multi-Library system (Family,
  675. Library, and Unit Managers) which provides a powerful and flexible way to
  676. manage Ada development efforts and share program units;  AdaExec real-time
  677. executive, for complete and efficient support for executing Ada programs; and
  678. ISO-standard mathematical library.  Also included is the Alsys Ada Toolset
  679. including AdaProbe, symbolic source level debugger and program viewer;
  680. AdaXref, cross-reference  generator; AdaMake, recompilation aid; and
  681. AdaReformat, source reformatter.
  682.  
  683. Bindings to the Generic Package of Elementary Functions and to OSF/Motif are
  684. currently available for the Alsys Ada Software Development Environment running
  685. on any SPARC-based Workstation as both host and target and running SunOS or
  686. SunView.
  687.  
  688. Host/Target:SPARC under SUNOS
  689.  
  690. For more information, contact:Scott Garren, Alsys, Inc., 67 South Bedford
  691.                         Street, Burlington, MA  01803-5152, USA;  Phone:
  692.                         (617) 270-0030
  693.  
  694.  
  695. Digital Equipment Corporation                              (Updated:  November
  696. 1 992)
  697.  
  698. Digital Equipment Corporation has bindings available for GKS, PHIGS, SQL, and
  699. OSF Motif for VAX Ada/VMS.  The Ada bindings are provided either as part of a
  700. compiler product or the services/facilities that are provided by Digital and
  701. its suppliers.
  702.  
  703. Host/Target:DEC VAX under VMS
  704.  
  705. For more information, contact:Mary Anne Cacciola, Digital Equipment
  706.                         Corporation, 110 Spit Brook Road, Nashua, NH  03062,
  707.                         USA; Phone:  (603) 881-1028
  708.  
  709.  
  710. IBM                                                        (Updated:  November
  711. 1 992)
  712.  
  713. IBM's AIX Ada/6000 product provides a binding to GPEF and IBM AIXWindows (X-
  714. Windows ... not Motif).  It runs on all models of the IBM RISC System/6000
  715. under the IBM AIX Version 3.2 operating system. See also entries for Systems
  716. Engineering Research Corporation (SERC) and Advanced Technology Center (ATC)
  717. for Motif, GKS or PHIGS bindings for use with IBM AIX Ada/6000 products.
  718.  
  719.  
  720. The AIX Ada/6000 licensed programs (5706-291 and 5706-294) consist of an
  721. optimizing compiler, a run-time environment, a symbolic debugger, an Ada
  722. "makefile" generator for use in automating and minimizing recompilation, Ada
  723. library management tools and Ada language bindings to some key AIX subsystems.
  724. With the exception of some system-specific aspects of the language, the Ada
  725. language for the AIX operating system is source compatible with the Ada
  726. language supported by IBM licensed programs in VM/CMS and MVS.
  727.  
  728. Host/Target:IBM RISC System/6000 under the IBM AIX Version 3.2 operating
  729.             system
  730.  
  731. This product conforms to the following standards:  ANSI/MIL-STD-1815A - Ada at
  732. current level (1.11) of the ACVC test suite.
  733.  
  734. For more information, contact:Barry Lee, IBM Corporation, 844 Don Mills Road,
  735.                         North York, Ontario, Canada  M3C 1V7; Phone:  (416)
  736.                         448-3174; Fax: (416) 448-4810
  737.  
  738. Objective Interface Systems, Inc.                          (Updated:  November
  739. 1 992)
  740.  
  741. Objective Interface Systems, Inc., has an Ada binding to X-windows (OSF Motif)
  742. for its Screen Machine~ product.  The Screen Machine binding to Motif includes
  743. a WYSIWYG drawing tool and an Ada code generator.
  744.  
  745. Host/Target:
  746.  
  747.       Sun SPARC/SunOS         Rational R1000/Delta    HP 9000/7XX; 8X7
  748.       IBM RISC System/6000/AIXPC 386/486/ISC UNIX     HFSI WIS Workstation
  749.       PC 286/386/486/MS-DOS   PC 386/486/SCO UNIX     DEC Ultrix; DEC VMS
  750.  
  751. For more information, contact:Phil Carrasco, Object Interface Systems, Inc.
  752.                         1895 Preston White Drive, Suite 250, Reston, VA
  753.                         22091-5448, USA; Phone: (703) 264-1900; Fax:
  754.                         703-264-1721; email info@ois.com (internet)
  755.  
  756.  
  757. SL Corporation                                              (Updated: November
  758. 1 992)
  759.  
  760. SL Corporation's SL-GMS toolkit includes Ada bindings to GPEF, GPPF, POSIX,
  761. SQL, TCP/IP, OSF/Motif, and Open Look.
  762.  
  763. SL-GMS is a toolkit for developing dynamic graphics screens for real-time or
  764. highly interactive applications.  Non-programmers can design application
  765. screens in a standard drawing-tool mode, connect them to real-time data
  766. sources and animate screen objects to visualize changing data values.  SL-GMS
  767. allows the design of custom "GISMOs" to input values or control the
  768. application and supports MOTIF, OPEN LOOK and other X toolkit widgets.
  769.  
  770. SL-GMS is used extensively to provide real-time graphics for applications in
  771. the fields of manufacturing, process control, network management, avionics and
  772. financial tracking.
  773.  
  774. Host/Target:Validated Verdix and DEC compilers support SL-GMS for the
  775.             following machines as both host and target:
  776.  
  777.  
  778.       DEC-DECstation/ULTRIX 4.0DEC-VAXstation/ULTRIX 4.0
  779.       DEC-VAXstation/VMS 5.4  DEC-VAXstation/VMS 5.5
  780.  
  781.       IBM-RS6000/AIX
  782.  
  783.       HP-9000/300/UNIX        HP-9000/400/UNIX
  784.       HP-9000/800/UNIX        HP-9000/700/UNIX
  785.  
  786.       PC-386/IX UNIX          PC-386/SCO UNIX
  787.       PC-386/Lynx             PC-386/0S2
  788.       PC-386/System 5.4
  789.  
  790.       SGI-4D/IRIX 3.3
  791.  
  792.       Sun-3/SunOS 4.1         SunSPARC/SunOS 4.1
  793.  
  794.       88 Open/BCS Compliant
  795.  
  796. For more information, contact: Mike Meagher, SL Corporation, 240 Tamal Vista
  797.                         Boulevard, Corte Madera, CA  94926, USA Phone: (415)
  798.                         927-1724; Fax: (415) 927-2931
  799.  
  800.  
  801. Sunrise Software International                                  (Updated:  May
  802. 1 992)
  803.  
  804. Sunrise Software International's product, ezx, is a rapid application
  805. development tool that automates the creation of graphical user interfaces for
  806. OSF/MOTIF and generates C, UIL, or Ada.  ezx provides WYSIWYG screen layout;
  807. color, font and pixmap editors; presentation tools and dialog management.  A
  808. prototype can be developed in hours and using a script language similar to
  809. Hypertalk, demonstrated to end-users before the first line of code is written.
  810. Then portable C, UIL or Ada can be generated automatically.  Ada bindings are
  811. provided.  The total code required to develop a GUI is reduced by
  812. approximately 75%.   The appearance and behavior of the GUI is defined in an X
  813. resource file which the application loads at run time.  This provides explicit
  814. separation between the GUI and the computational core of the application. Thus
  815. the GUI can be revised without recompiling (and retesting) the application.
  816.  
  817. ezx provides cost savings throughout the software development cycle, from
  818. requirements analysis through design, code, test and maintenance.
  819.  
  820.  
  821. Host/Target:DEC RISC under ULTRIX, DEC VAX under VMS, IBM 386 under UNIX, IBM
  822.             RS 6000 under AIX, SGI under , SUN SPARC under UNIX
  823.  
  824. For more information, contact:Frederick Sells, Sunrise Software International,
  825.                         170 Enterprise Center, Middletown, RI  02840, USA;
  826.                         Phone:  401-847-7868
  827.  
  828. Systems Engineering Research Corporation (SERC)            (Updated:  November
  829. 1 992)
  830.  
  831. SERC's Ada/MOTIF is a complete binding to X Window and OSF/Motif for the Ada
  832. programming language that was based in part upon the SAIC/Unisys (STARS)
  833. public domain bindings.  That work was leveraged as a starting point for this
  834. development; many of the bug fixes and additional capabilities beyond the
  835. public domain releases in Ada/MOTIF have been incorporated.  Most noteworthy
  836. are the capabilities included in Ada/Motif for Ada tasking, callback
  837. registration, memory leak detection/prevention and capabilities for developing
  838. customized widgets.  Paramax/STARS considers Ada/Motif to be the commercial
  839. version of their STARS bindings, according to SERC.
  840.  
  841. Ada/MOTIF is supported by the ALSYS, VERDIX, SUNAda, IBM Ada, and SGI Ada
  842. compilers.
  843.  
  844.  
  845. Host/Target:SUN 4, HP 300/400, HP 700, IBM RS 6000, SGI, 386
  846.             SUN OS 4.1.1, SOLARIS 2.0 (coming), HPUX 8.0, SGI 3.2 & 4.0, IBM
  847.             ATX 3.2, SCO 3.2
  848.  
  849. For more information, contact:Theo Kusiolek or Scott Cleveland, Systems
  850.                         Engineering Research Corporation (SERC), 2555
  851.                         Charleston Road, Mountain View, CA  94043, USA; Phone:
  852.                         800-ADA-SERC or 415/962-9092; Fax:  415/962-0330;
  853.                         E-mail:  Well!sercmail@apple.com.
  854.  
  855.  
  856. TeleSoft                                                   (Updated:  November
  857. 1 992)
  858.  
  859. TeleSoft's TeleUSE/Ada automates the creation of OSF/Motif graphical user
  860. interfaces for Ada applications.  It includes a special version of the TeleUse
  861. User Interface Management System -- which generates Ada source code -- and Ada
  862. bindings to the TeleUSE run-time routines.
  863.  
  864. TeleUse/Ada tools allow a GUI to be prototyped and designed using a WYSIWYG
  865. editor and a PDL, and also includes tools for debugging, generating production
  866. code and maintaining the GUI.  TeleUse/Ada can save the developer up to 90
  867. percent of the time required to hand code X Window System GUIs.
  868.  
  869. Host/Target:SPARC under UNIX, Sun-4 under UNIX
  870.  
  871.  
  872. TeleSoft's TeleWindows is a set of Ada bindings to the X Window System and
  873. OSF/Motif.  This includes Xlib, XT, X extensions Library, XT+, X miscellaneous
  874. utilities, Motif widget set, XM, MWM, Motif resource manager.  It supports X-
  875. 11 R4 and is not based on the public domain version.  It closely follows the C
  876. Xlib syntax and allows Ada applications to co-exist with C applications.
  877.  
  878. Host/Target:IBM System/370 under VM/CMS
  879.  
  880. For more information, contact:Karen Johnson, TeleSoft, 5959 Cornerstone Court
  881.                         West, San Diego, CA  92121-9891, USA; Phone:  (619)
  882.                         457-2700
  883.  
  884. Verdix                                                          (Updated:  May
  885. 1 992)
  886.  
  887. The Verdix Ada Development System (VADS), is a complete Ada Compiler System
  888. offering a fully validated Ada compiler with chapter 13 support.  Verdix
  889. supplies VADSself and VADScross.   VADSself provides a complete toolset for
  890. self-targeted applications.  It easily interfaces to databases, windowing
  891. systems and program management tools.  VADScross provides real-time support
  892. for host-to-target system development.  VADScross produces small and fast
  893. object code.  VADS is hosted on the largest number of platforms and targets
  894. the greatest number of microprocessors.
  895.  
  896. Host/Target:88000 BCS under UNIX, DEC VAX under VMS / ULTRIX / UNIX,
  897.             DECStation (RISC) under UNIX, DECSystem (RISC) under UNIX, HP 9000
  898.             Series 300 under HP-UX  (UNIX), IBM PS/2 under AIX  (UNIX), IBM
  899.             RISC System/6000 under AIX, SCO Systems V/386 (ABI) under UNIX,
  900.             Sun SPARC systems under UNIX, Sun-3 systems under UNIX
  901.  
  902. Verdix AXI provides an Ada binding to the full Motif, Xt, and Xlib libraries.
  903. The product works with user-supplied Motif 1.1 and X11R4 libraries regardless
  904. of source.
  905.  
  906. Host/Target:DEC RISC under Ultrix, IBM RS6000 under AIX, MIPS under MIPSos,
  907.             Sun-4 under SunOS, Sys V386 under ISC UNIX, Sys V386 under SCO
  908.             UNIX
  909.  
  910. For more information, contact:Tim Ruhe, Verdix Corporation, 205 Van Buren,
  911.                         Herndon, VA  22070, USA; Phone:  (703) 318-5800
  912.  
  913.  
  914. -----------------------------------------------------------------------------
  915. Subject: 106)+  Is there a Poplog binding for Motif?
  916.  
  917. [Last modified: May]
  918.  
  919. Answer:
  920.  A integrated programming environment consisting of the programming
  921.     languages Pop-11, Prolog, Standard ML, and Lisp which are compiled
  922.     to machine code via a common virtual machine. Pop-11 provides a rich
  923.     interface to the X Toolkit which can be accessed from all other
  924.     Poplog languages. The OLIT, Motif, and Athena widget sets are
  925.     supported, in addition to the custom Poplog (Xpw) widget set. XVed
  926.     provides a sophisticated, customisable multi-window editor. Under
  927.     OPEN LOOK and Motif the Poplog User Interface (PUI) provides a
  928.     graphical interface to the Poplog system. High-level Pop-11
  929.     libraries allow graph drawing, turtle graphics, and the simple
  930.     creation of basic button/menu based interfaces.
  931.  
  932. Contact:
  933.  
  934.     UK EDUCATION SITES:
  935.         Poplog Sales. School of Cognitive and Computing Sciences.
  936.         Brighton. BN1 9QN. England.
  937.         Phone: +44 (0)273 678188
  938.         Email: popsales@cogs.susx.ac.uk
  939.     USA AND CANADIAN EDUCATION SITES:
  940.         Computable Functions Inc. 35 South Orchard Drive. Amherst.
  941.         MA 01002. USA.
  942.         Phone: (413) 253-7637
  943.     ALL OTHER SALES:
  944.         Integral Solutions Ltd. Unit 3, Campbell Court. Bramley.
  945.         Basingstoke. Hampshire. RG26 5EG. England.
  946.         Phone:  +44 (0)256 882028
  947.         Fax:    +44 (0)256 882182
  948.         Email:  isl@integ.uucp
  949.  
  950.  
  951.  
  952. -----------------------------------------------------------------------------
  953. Subject: 107) TOPIC: SPECIFIC PLATFORMS
  954.  
  955. -----------------------------------------------------------------------------
  956. Subject: 108) Is it easy to build Motif for a Sun?
  957.  
  958. Answer: See next question for Solaris 2.  No pattern has emerged to problems
  959. about compiling Motif on the Sun (although people seem to have a lot of
  960. different minor problems), and many reports are that it is straightforward.
  961. Read the Motif install instructions (which often have specific reference to
  962. Sun installation), light the blue touch paper and just standback. [My
  963. experience was that I had to add -D_NO_PROTO for 1.1 on a Sparc OS 4.1, and
  964. that was all.  Others have added STRINGS_ALIGNED and NO_REGEXP].
  965.  
  966.  
  967. -----------------------------------------------------------------------------
  968. Subject: 109)  How do I build Motif 1.2.2 on Solaris 2.1 with Sun C?
  969.  
  970. [Last modified: May 93]
  971.  
  972. Prepared by Ric Steinberger.  ric@updike.sri.com  4/09/93
  973.  
  974. What follows is a description of the steps I used to build Motif 1.2.2 on a
  975. SUN IPX running Solaris 2.1.  Sun's C compiler (2.0.1) was used.  Many thanks
  976. go to Kaleb Keithley (kaleb@devvax.jpl.nasa.gov) for several useful
  977. suggestions.  Other people, including OSF staff, especially David Brooks
  978. (dbrooks@osf.org), helped as well.  My thanks to you all.
  979.  
  980. 1. Build X11R5 from the mit distribution.  You need to retrieve the sources
  981.    from export.lcs.mit.edu (in pub/R5) and patches 1 - 22 (or 23) (in
  982.    pub/R5/fixes).  There are several other sites that contain the X11R5
  983.    sources.  After installing patch 19, apply PEXlib.tar.Z, also available
  984.    from export.lcs.mit.edu in pub/R5/fixes.  You can apply also
  985.    R5.Xsun.multi-screen and R5.SunOS5.patch.  There are .README files
  986.    that explain how to patch.  Be SURE to read
  987.    R5.SunOS5.patch.README for details on how to BUILD X11.  You probably
  988.    want to use the ProjectRoot feature in the site.def file in the
  989.    mit/config directory.  You will NEED to edit that file to do that.
  990.  
  991. 2. Obtain the Motif 1.2.2 distribution from OSF (617-621-7300).  You may
  992.    need to first install the 1.2 tape, then the 1.2.1 and finally the
  993.    1.2.2 tape.  You might want to do a "chmod -R u+w ." after unloading
  994.    each tape.
  995.  
  996. 3. In the config directory, there are several changes.  Some of the changes
  997.    are based on R5.SunOS5.patch files.  A complete set of config files
  998.    relevant to Solaris have been placed in the anon-ftp account of
  999.    updike.sri.com in pub/motif/solaris21-motif122-config.tar.Z.  They are
  1000.    also available from OSF on their mail response server (available to
  1001.    support contract holders) and they will send them directly to full
  1002.    support contract holders.  Decompress and untar this file in your Motif
  1003.    config subdirectory.  Copy site.def.sample to site.def, then edit
  1004.    site.def.  You will probably want to uncomment the ProjectRoot section
  1005.    and use the same value used in your X11R5 build.  Also, you will probably
  1006.    want to use /usr/ucb/install in you installed the UCB compatibility
  1007.    suite.  Otherwise you might want to use the install supplied at the end
  1008.    of this memo.  [I used the UCB version and can't swear that this works.
  1009.    Bit it should.  Put it someplace like /usr/local/bin and chmod +x it.]
  1010.  
  1011.    There are two patches to consider.  One fixes a cursor problem
  1012.    in ./lib/Xm/TextF.c.  The other removes a Berkeleyism.  These
  1013.    patches should probably be consider unofficial at present.
  1014.    Failure to deal with the Berkeleyism (bzero) means you will need to
  1015.    link with -lucb -lelf.  This will probably work, but why bother?
  1016.    Furthermore, if you move the Motif binaries to a machine without
  1017.    the ucb compatability suite, you won't have the sharable libs you need.
  1018.  
  1019. [The actual patches have been censored because they contain OSF source code]
  1020.  
  1021.    Patch 1: In TextF.c there are several places _XmTextFieldDrawInsertionPoint
  1022. is called. These should be moved two or three lines further down *after* the
  1023. "if (!XtIsRealized(tf)) return True;" statement.
  1024.  
  1025.  
  1026.    patch 2: The call to bzero in lib/Xm/Visual.c should be replaced by the
  1027. equivalent call to memset
  1028.  
  1029.  
  1030.     Both these patches can be applied in the ./lib/Xm directory.
  1031.     If you don't have the patch program (how did you build X11?),
  1032.     you can get it in the vendor/cygnus directory of ftp.uu.net,
  1033.     or you can build it from source.  Be sure to get the latest
  1034.     version (2.0.12.u8).
  1035.  
  1036. 4) Use the README-1.2.1 file as a guideline for building motif.  I followed
  1037.    directions in the section called, "Using X11R5 Installed Libraries
  1038.    and Header Files."  If you make a mistake after your first build
  1039.    attempt, copy Makefile.ini to Makefile before retrying.  You may
  1040.    need to do this in the config subdirectory too, depending on what
  1041.    went wrong.
  1042.  
  1043. 5) After make Makefiles, do make includes, make depend, then make (or
  1044.    as OSF recommends, make -k).  This gets as far as motifshell in the
  1045.    demos, which fails to build because O_RDONLY and L_XTND are
  1046.    not defined.  O_RDONLY is in fcntl.h (actually <sys/fcntl.h>, but
  1047.    fcntl.h includes this.)  L_XTND can be replaced by SEEK_END.
  1048.    SEEK_END is in stdio.h.  These two fixes will allow motifshell to build.
  1049.    Note: many MANY compiler warning messages will be generated during
  1050.    the build process.
  1051.  
  1052. 6) You can go to the demos/xmsamplers directory and do a make there.
  1053.    Other demos may build, or not depending on whatever. . . .
  1054.  
  1055. 7) make install will do the install.  [It will fail at motifshell
  1056.    if you don't fix it, as mentioned above.]  You can do a make install
  1057.    in demos/xmsamplers if you want these.
  1058.  
  1059. 8) If running on a SUN (as opposed to an X term), you will (probably) need
  1060.    to start openwin with something like:
  1061.  
  1062.         openwin -server /usr/X11R5/bin/Xsun
  1063.  
  1064.  
  1065.    [You might want to use an alias for this.]
  1066.    This fixes an annoying problem: The mouse keys stop working after you
  1067.    click on an icon to get the icon menu (on SUNs only, not X terms).
  1068.    The ALT keys still work, if you get stuck.  I don't know whether this
  1069.    is a bug in SUN's server or whether it is Motif related.
  1070.  
  1071.    Here is a copy of my .xinitrc:  It's not elegant.  Sun's default
  1072.    openwin startup file is in: /usr/openwin/lib/Xinitrc.  You can
  1073.    copy this to ~/.xinitrc and customize as desired.  Obviously, the
  1074.    default behavior is to start the OpenLook environment (boo!).
  1075.  
  1076.  
  1077. #!/bin/sh
  1078. #
  1079. # .xinitrc - OpenWindows startup script.
  1080. #
  1081. if [ -f $HOME/.Xdefaults ]; then
  1082.     xrdb $HOME/.Xdefaults              # Load Users X11 resource database
  1083. fi
  1084. if [ -f $HOME/.Xdefaults.sun ]; then
  1085.     xrdb -merge $HOME/.Xdefaults.sun
  1086. fi
  1087. DISPLAY=`hostname`:0.0
  1088. export DISPLAY
  1089. xhost + > /dev/null
  1090. #xterm -sb -sl 512 -T `hostname` -ls -n `hostname` &
  1091. xterm -sb -sl 512 -T `hostname` -n `hostname` &
  1092. mwm &
  1093. xclock -geometry +1010+0 &
  1094. xload -geometry +710+5 -fg red &
  1095. xsetroot -solid salmon &
  1096. xterm -sb -sl 100 -T CONSOLE_DO_NOT_LOGOUT -C -n console -iconic
  1097. #wait
  1098.  
  1099. Here's .Xdefaults.sun, which gives me a more readable font for use with
  1100. motif on Sun monitors:
  1101.  
  1102. !Some additional .Xdefaults values specifically for SUN
  1103. !
  1104. ! After loading .Xdefaults, xrdb -merge .Xdefaults.sun
  1105. !
  1106. Mwm*fontList:           8x16
  1107. !Mwm*fontList:          vtbold
  1108. !Change as desired.
  1109.  
  1110.  
  1111.      You will probably want to maintain LD_LIBRARY_PATH to something like:
  1112. /opt/SUNWspro/lib:/usr/ccs/lib:/usr/ucblib:/usr/X11R5/lib:/usr/lib:
  1113. /usr/openwin/lib.  If you use emacs, you will need to leave /usr/openwin/lib
  1114. there.  [This is because you probably, like me, used the distributed version
  1115. of s-sol2.h, which explicitly refers to windowing libraries as being in the
  1116. /usr/openwin locations.  Yes, I know that emacs/Solaris ought to allow
  1117. LibXt.so.N.M to be "picked up" from elsewhere, like /usr/X11R5/lib, but the
  1118. one emacs links with is LibXt.so.4.something, and the mit one is
  1119. LibXt.so.5.something.  So it seems to want the .4 one.  Any comments?  I'd
  1120. prefer not to rebuild emacs based on the X11R5 libs because I occassionally
  1121. need to move the emacs binaries to machines without the mit files.]
  1122.  
  1123. -----------------------------------------------------------------------------
  1124. Subject: 110) What compile errors/warnings might I get in both Sun 3 and Sun
  1125. 4?
  1126.  
  1127. Answer:
  1128.  
  1129.  
  1130. make: Warning: Too many rules defined for target
  1131. make: Warning: Too many rules defined for target
  1132. "callbacks.c", line 1530: warning: illegal combination of pointer
  1133. and integer, op =
  1134. "callbacks.c", line 1531: warning: illegal combination of pointer
  1135. and integer, op =
  1136. "callbacks.c", line 1532: warning: illegal combination of pointer
  1137. and integer, op =
  1138. "utils.c", line 73: warning: illegal combination of pointer and integer, op =
  1139. "utils.c", line 74: warning: illegal combination of pointer and integer, op =
  1140. "utils.c", line 122: warning: illegal combination of pointer and integer, op =
  1141. "utils.c", line 123: warning: illegal combination of pointer and integer, op =
  1142. "utils.c", line 191: warning: illegal combination of pointer and integer, op =
  1143. "utils.c", line 194: warning: illegal combination of pointer and integer, op =
  1144. "utils.c", line 195: warning: illegal combination of pointer and integer, op =
  1145. "utils.c", line 196: warning: illegal combination of pointer and integer, op =
  1146. "utils.c", line 316: warning: illegal combination of pointer and integer, op =
  1147. "utils.c", line 334: warning: illegal combination of pointer and integer, op =
  1148. "utils.c", line 338: warning: illegal combination of pointer and integer, op =
  1149. "utils.c", line 341: warning: illegal combination of pointer and integer, op =
  1150. "xmdialogs.c", line 838: warning: illegal combination of pointer
  1151. and integer, op =
  1152. "xmeditor.c", line 1152: warning: illegal combination of pointer
  1153. and integer, op =
  1154.  
  1155. These warning messages can be ignored. OSF is aware of these warnings.
  1156.  
  1157.  
  1158. -----------------------------------------------------------------------------
  1159. Subject: 111) On a Sun 3, what are the mwm startup error messages about?  I
  1160. get
  1161.  
  1162. mwm: Invalid accelerator specification on line 7 of
  1163.      specification string
  1164. mwm: Invalid accelerator specification on line 31 of
  1165.       configuration file
  1166.  
  1167.  
  1168. Answer: This is because some Sun keyboards do not have an F10 key and some sun
  1169. workstations which have an F10 key do not have X-servers which recognize it.
  1170. The F10 key is used by mwm.  If the machine does have an F10 key, the user
  1171. should use xmodmap to tell the server it exists.  Otherwise, change the
  1172. definition of the DefaultWindowMenu in /usr/lib/X11/system.mwmrc (after
  1173. installation) or in /lib/clients/mwm/system.mwmrc (before installation).
  1174. Change the accelerator of "Maximize" (it is "Alt<Key>F10)" to something else.
  1175. Also, you should change the definition of DEFAULTSYSTEMMENU in the file
  1176. /clients/mwm/WmResource.c in a similar fashion.  There is as yet no standard
  1177. redefinition for F10.
  1178.  
  1179.  
  1180.  
  1181. -----------------------------------------------------------------------------
  1182. Subject: 112) Are there problems making shared libraries on a Sun?
  1183.  
  1184. Answer: If you use the -pic option you may run out of offset table space.  use
  1185. the -PIC option instead.
  1186.  
  1187. You may get the message "ld.so: Undefined symbol: __XtInherit" when executing
  1188. UIL. There is a problem in shared library build when you compare a function
  1189. variable to a routine name, but don't call the routine.  Either, you can build
  1190. the Xt library nonshared, or you can put a reference to XtToolkitInitialize in
  1191. the UIL main program (or even include a module that references it).  The
  1192. routine doesn't even have to be called; it just has to be there.
  1193.  
  1194.  
  1195. -----------------------------------------------------------------------------
  1196. Subject: 113)  The OpenWindows server hangs when I popup a menu with Button 3.
  1197. [Last modified: August 92]
  1198.  
  1199. Answer: This is an OpenWindows problem, but if you have Motif source you can
  1200. fix your own applications. From Steve Sistare of Thinking Machines Corp.:
  1201. "Change the 2 calls to XtGrabButton in RowColumn.c such that ButtonReleaseMask
  1202. | ButtonPressMask is passed for the event mask.  Currently, only
  1203. ButtonReleaseMask is passed.  Also, change the owner_event argument to FALSE.
  1204. " This has not been fixed in Motif as at 1.1.5.
  1205.  
  1206. -----------------------------------------------------------------------------
  1207. Subject: 114) Has anyone made shared libraries on an IBM RS/6000?
  1208.  
  1209. Answer: From Sakari Jalovaara: There is a problem: Xm redefines VendorShell
  1210. and the AIX linker put _both_ Xm's and Xt's VendorShell into programs.  When
  1211. an AIX shared library is created as many references inside the library are
  1212. resolved as possible.  If the symbol vendorShellClassRec is defined in libXt
  1213. and referenced, say, from a function XtFoo() also in libXt, the "ld" run that
  1214. creates the shared library resolves the reference:
  1215.  
  1216.         XtFoo() -> vendorShellClassRec
  1217.  
  1218. Then I create the Motif library that has its own vendorShellClassRec and an
  1219. XmBar() function that uses it; libXm will also contain a resolved reference to
  1220. vendorShellClassRec:
  1221.  
  1222.         XmBar() -> vendorShellClassRec
  1223.  
  1224. Finally, I link a program that uses both XtFoo() and XmBar() and the program
  1225. will end up with _two_ independent "vendorShellClassRec"s:
  1226.  
  1227.         XtFoo() -> vendorShellClassRec [Xt version]
  1228.         XmBar() -> vendorShellClassRec [Xm version]
  1229.  
  1230. Instant schizo zaphod mode.  In reality, vendorShellClassRec is not referenced
  1231. from functions but from other widget class records.
  1232.  
  1233. I can't just pull Vendor.o out from the shared Xt (Vendor.o appears to define
  1234. the only external symbols redefined by libXm) because AIX shared libraries
  1235. apparently can't contain unresolved external references.  If I take out
  1236. Vendor.o I have to take out every other file that uses symbols defined there -
  1237. and then files that need those files, etc.  I tried it and ended up with three
  1238. or four object files in libXt and the res non-sharable.
  1239.  
  1240. I kludged around this by putting all of libXt (minus Vendor.o) into the shared
  1241. libXm.  It isn't a pretty solution but it works - and beats having a
  1242. statically linked two-megabyte "periodic" demo...
  1243.  
  1244.  
  1245. -----------------------------------------------------------------------------
  1246. Subject: 115)  What is the error  "Unaligned access in XmString" under Ultrix?
  1247.  
  1248. Answer: Compile  XmString.c with STRINGS_ALIGNED.
  1249.  
  1250. -----------------------------------------------------------------------------
  1251. Subject: 116) TOPIC: KEYSYMS
  1252.  
  1253. -----------------------------------------------------------------------------
  1254. Subject: 117)  What is causing the messages "unknown keysym osfDown..."?  It
  1255. happens when I run an application under Motif 1.1
  1256.  
  1257. Answer: There is an OSF supplied addition to the /usr/lib/X11/XKeysymDB file.
  1258. It is found on the release tape and should have been automatically installed
  1259. if the installation procedure was followed in the Release Notes.
  1260.  
  1261. You have to copy (or append) lib/Xm/XKeysymDB into /usr/lib/X11.  This may
  1262. require root permission.  It is not clear how to fix the problem if you can't
  1263. do this.  The error comes from Xt translation table parsing and can't be fixed
  1264. in Motif, so if you can't get root permission you may be stuck.  The file is
  1265. not copyrighted so you can install it on other systems.
  1266.  
  1267. If X has been built so that XKeysymDB is not in this directory, and you don't
  1268. know where it is looking, run 'strings libX11.a | grep XKeysymDB' to find the
  1269. path.
  1270.  
  1271. On a Sun running openwin with shared libraries, you may need to put the path
  1272. for the library containing XKeysymDB *first* in the path list in
  1273. LD_LIBRARY_PATH, or it may find the wrong XKeysymDB in the wrong directory.
  1274.  
  1275. XKeysymDB simply contains the registered keysym values for the OSF keysyms.
  1276. The OSF values are server-independent.  And, all registered keysyms will be
  1277. included in an XKeysymDB file to be shipped with X11R5.
  1278.  
  1279. In the meantime (till all systems are X11R5+), a list of the registered
  1280. keysyms can be found in the X11R4 release in mit/doc/Registry/Xregistry.
  1281.  
  1282.  
  1283.  
  1284. -----------------------------------------------------------------------------
  1285. Subject: 118) What happens if I can't install Motif Keysyms?
  1286.  
  1287. From: tessi!george@nosun.West.Sun.COM (George Mitchell)
  1288.  
  1289. Here's what appears to happen if you don't have XKeysymDB in place to define
  1290. OSF's virtual keysyms:
  1291.  
  1292. 1. At class initialize time, for a widget (such as XmText) that uses virtual
  1293. keysyms in its event translation table, all entries which refer to those
  1294. keysyms fail to parse correctly.  In the case of XmText, instead of ending up
  1295. with a translation table with roughly 90 entries, you end up with one that has
  1296. 29.
  1297.  
  1298. 2. XKeysymDB doesn't exist, so you'd assume that KeyPress events will get
  1299. translated to plain vanilla keysyms, right?  WRONG!  All Motif widgets install
  1300. a virtual keysym translator ANYWAY!  Consequently, the backspace key (for
  1301. example) gets translated to the keysym osfBackSpace.
  1302.  
  1303. 3. Therefore, if you augment or override your widget's translations with
  1304. translations that refer to plain vanilla BackSpace, they will never be
  1305. triggered, because you will NEVER see plain vanilla BackSpace, only
  1306. osfBackSpace.
  1307.  
  1308. 4. But you can't use osfBackSpace in an event translation entry, because you
  1309. don't have XKeysymDB installed!
  1310.  
  1311. Here's how I'm "dealing" with the problem right now: Motif installs its
  1312. virtual keysym translator by calling XtSetKeyTranslator every time a
  1313. VendorShell (or subclass) widget is created.  So every time I create a shell,
  1314. I immediately call XtSetKeyTranslator (display, XtTranslateKey) to restore the
  1315. default translator.  No more funny virtual keysyms!  Now I can reinstall non-
  1316. osfKeySym translations and have them work the way I expect.
  1317.  
  1318.  
  1319. -----------------------------------------------------------------------------
  1320. Subject: 119) Why has OSF introduced Keysyms into Motif 1.1?  They weren't
  1321. there in Motif 1.0.
  1322.  
  1323. Answer: From: ellis@osf.org
  1324.  
  1325. Virtual Keysyms are meant to provide a consistent keyboard model for Motif
  1326. applications running in a heterogeneous environment in which proprietary (i.e.
  1327. vendor specific) non-Motif applications may also be running.
  1328.  
  1329. First of all, for the sake of the rest of the readers, let's explain why this
  1330. is an issue:
  1331.  
  1332. It would be lovely if Motif's translation tables could just use the obvious
  1333. keysyms predefined by X.  For example, there are keysyms for XK_BackSpace,
  1334. XK_Delete, XK_Left, XK_Right, etc.  Shouldn't these be the ones that are used
  1335. in our translations?  Unfortunately, the problem is not so simple.  Some
  1336. specific examples:
  1337.  
  1338.    While most vendors bind XK_BackSpace to the key at the top right
  1339.    of the standard keyboard (often engraved with a leftwards
  1340.    pointing arrow), not all do.  In fact, some vendors (including DEC)
  1341.    bind that key to XK_Delete.
  1342.  
  1343.    While most vendors bind the arrow keys to XK_Up, etc, a number of
  1344.    vendors (including Sun, on some servers) bind them to function key
  1345.    keysyms.
  1346.  
  1347. A simplistic solution would require the use of xmodmap to change the offending
  1348. bindings.  That would work swell in an all Motif environment.  However, OSF's
  1349. goal (not always perfectly achieved) is interoperability.  That is, we'd like
  1350. to make sure that both Motif and non-Motif programs can happily run in the
  1351. same environment.
  1352.  
  1353. It is expected that a vendor may have a wide variety of existing X-based
  1354. software that uses the keysyms as established by that vendor for specific
  1355. purposes.  It is expected that these applications may run at the same time as
  1356. Motif-based software.  Using xmodmap to change keysyms on the server side
  1357. could "break" the existing applications (or at the very least their
  1358. documentation) by making some keys unavailable, or by moving the location.
  1359.  
  1360. So, we chose not to use xmodmap.  By the way, though OpenLook uses a different
  1361. implementation (they recompile their virtual translation tables into actual
  1362. translation tables), they basically adopted the same approach, presumably for
  1363. similar reasons.
  1364.  
  1365. To work properly, the virtual keysym model we implemented depends on Xlib
  1366. finding XKeysymDB installed appropriately (which standard Motif installation
  1367. does).  This simply defines the keysyms (not the key they are bound to).  This
  1368. unfortunate piece of stupidity is necessary because MIT only includes standard
  1369. keysyms in keysymdef.h.  It should be said that our lives would be made easier
  1370. if MIT would also see fit to include registered keysyms in keysymdef.h as
  1371. well.
  1372.  
  1373. Motif applications determine how to bind virtual to actual keys by looking for
  1374. either a resource or a property on the root window which describes what to do.
  1375. Note that this information is on the server side, so that all applications use
  1376. the same virtual bindings regardless of where they are running.  Mwm will
  1377. happily create the property if it finds a .motifbind file in your home
  1378. directory when it starts up.  (Actually, things generally work even if none of
  1379. this is done, since if all else fails, the Motif toolkit chooses a virtual
  1380. bindings table to use based on the identification of the server).
  1381.  
  1382. The actual implementation of virtual keys is made possible by a hook in the
  1383. Intrinsics.  Undoubtably, the implementation would be simpler and cleaner if
  1384. virtual key support was more directly supported by the Intrinsics.  We will be
  1385. exploring this possibility in the future.
  1386.  
  1387.   -- Ellis
  1388.  
  1389. -----------------------------------------------------------------------------
  1390. END OF PART FOUR
  1391. --
  1392. +----------------------+---+
  1393.   Jan Newmarch, Information Science and Engineering,
  1394.   University of Canberra, PO Box 1, Belconnen, Act 2616
  1395.   Australia. Tel: (Aust) 6-2012422. Fax: (Aust) 6-2015041
  1396.